from django.db import models
from projects.models import ProjectType

class ProjectStatistic(models.Model):
    type = models.ForeignKey(ProjectType, on_delete=models.CASCADE, verbose_name='项目类型')
    apply_count = models.IntegerField(default=0, verbose_name='申报数量')
    finish_count = models.IntegerField(default=0, verbose_name='结项数量')
    total_count = models.IntegerField(default=0, verbose_name='项目总数')

class ProjectFinance(models.Model):
    type = models.ForeignKey(ProjectType, on_delete=models.CASCADE, verbose_name='项目类型')
    budget = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='项目预算', default=0)
    cost = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='项目费用', default=0)
    profit = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='项目盈亏', default=0) 